import axios from '@/libs/axios.js'
import baseUrl from './index'
let jsonHeaders = {'content-type': 'application/json;charset=UTF-8'}

// 登录
export const login = (params) => {
    return axios({
        // url: `${baseUrl}/identity/anonymity/designer/login`,
        // url: `${baseUrl}/dictionaries/anonymity/designer/login`,
        //url: `${baseUrl}//nsrep-by-operation/operationUserInfo/login`,
        url: `${baseUrl}/identity/anonymity/designer/login`,
        method: 'post',
        headers: jsonHeaders,
        data:params
    })
}


// 验证码
export const verCode = params => {
    return axios({
        url: `${baseUrl}/identity/anonymity/tokens`,
        method: 'get',
        headers: jsonHeaders,
        data:params
    })
}
// 用户信息
export const baseInfo = params => {
    return axios({
        url: `${baseUrl}/identity/account/info`,
        method: 'get',
        headers: jsonHeaders,
    })
}
// 登出
export const logout = params => {
    return axios({
        url: `${baseUrl}/identity/account/logout`,
        method: 'get',
        headers: jsonHeaders,
    })
}
// 菜单列表
// export const getdatalist = params  => {
//     return axios({
//       url: `${baseUrl}/sdn/sys/menu/all/list`,
//       method: 'get',
//       params:params,
//       headers: jsonHeaders
//     })
// }

// // 原来获取菜单接口（授权系统）
// export const getdatalist = params => {
//     return axios({
//       url: `${baseUrl}/identity/menu`,
//       method: 'get',
//       params:params,
//       headers: jsonHeaders
//     })
// }

// 现在根据运维配置得了
export const getdatalist = params => {
    return axios({
      url: `${baseUrl}/dictionaries/company/one`,
      method: 'get',
      params:params,
      headers: jsonHeaders
    })
}

// 令牌登录
export const loginToken = (params) => {
    return axios({
        url: `${baseUrl}/identity/anonymity/token/login`,
        method: 'post',
        headers: jsonHeaders,
        data:params
    })
}
// 令牌登录2
export const loginToken2 = (params) => {
    return axios({
        url: `${baseUrl}/identity/anonymity/token/aes/login`,
        method: 'post',
        headers: jsonHeaders,
        data:params
    })
}
// 获取系统logo
export const getLogoImg = (params) => {
    return axios({
        url: `${baseUrl}/new-paper/logo`,
        method: 'get',
        headers: jsonHeaders,
        params:params
    })
}

// 查询系统logo
export const queryLogoImg = (params) => {
    return axios({
        url: `${baseUrl}/new-paper/logo/list`,
        method: 'get',
        headers: jsonHeaders,
        params:params
    })
}
// 增加系统logo
export const saveLogoImg = (params) => {
    return axios({
        url: `${baseUrl}/new-paper/logo/saveLogo`,
        method: 'post',
        headers: jsonHeaders,
        data:params
    })
}

// 修改系统logo
export const updateLogoImg = (params) => {
    return axios({
        url: `${baseUrl}/new-paper/logo/updateLogo`,
        method: 'put',
        headers: jsonHeaders,
        data:params
    })
}

// 删除系统logo
export const deleteLogoImg = (id) => {
    return axios({
        url: `${baseUrl}/new-paper/logo/id/${id}`,
        method: 'delete',
        headers: jsonHeaders,
    })
}